package rpd.mapper;

import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import rpd.model.TbIndustry;
import rpd.model.TbIndustryExample;
import rpd.model.TbIndustryKey;

public interface TbIndustryMapper {
    long countByExample(TbIndustryExample example);

    int deleteByExample(TbIndustryExample example);

    @Delete({
        "delete from tb_industry",
        "where industry_id = #{industryId,jdbcType=CHAR}"
    })
    int deleteByPrimaryKey(TbIndustryKey key);

    @Insert({
        "insert into tb_industry (industry_id, industry_code, ",
        "industry_desc)",
        "values (#{industryId,jdbcType=CHAR}, #{industryCode,jdbcType=CHAR}, ",
        "#{industryDesc,jdbcType=CHAR})"
    })
    int insert(TbIndustry record);

    int insertSelective(TbIndustry record);

    List<TbIndustry> selectByExample(TbIndustryExample example);

    @Select({
        "select",
        "industry_id, industry_code, industry_desc",
        "from tb_industry",
        "where industry_id = #{industryId,jdbcType=CHAR}"
    })
    @ResultMap("rpd.mapper.TbIndustryMapper.BaseResultMap")
    TbIndustry selectByPrimaryKey(TbIndustryKey key);

    int updateByExampleSelective(@Param("record") TbIndustry record, @Param("example") TbIndustryExample example);

    int updateByExample(@Param("record") TbIndustry record, @Param("example") TbIndustryExample example);

    int updateByPrimaryKeySelective(TbIndustry record);

    @Update({
        "update tb_industry",
        "set industry_code = #{industryCode,jdbcType=CHAR},",
          "industry_desc = #{industryDesc,jdbcType=CHAR}",
        "where industry_id = #{industryId,jdbcType=CHAR}"
    })
    int updateByPrimaryKey(TbIndustry record);
}